<!--
 * @Author: your name
 * @Date: 2022-01-25 19:32:16
 * @LastEditTime: 2022-01-26 01:03:28
 * @LastEditors: Please set LastEditors
 * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 * @FilePath: \json-serveg:\桌面2\VueStudy\vue-ego\vue-ego\src\views\Goods\Editor.vue
-->
<template>
  <div id="mian">

  </div>
</template>

<script>
import E from "wangeditor"
export default {
  data() {
    return {
      editor: "",
    }
  },
    mounted() {
        this.editor = new E("#mian")

        // 取消自动 focus
        this.editor.config.focus = false
        // 配置 onchange 回调函数
        this.editor.config.onchange =  newHtml => {
          // console.log("change 之后最新的 html", newHtml);
          // console.log(this,newHtml);
          this.$emit('sendEditor',newHtml)
        };
        // 配置触发 onchange 的时间频率，默认为 200ms
        this.editor.config.onchangeTimeout = 1000; // 修改为 500ms
        
        this.editor.create()
    },
}
</script>

<style>

</style>
